package com.tony.server.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.tony.easymvc.mapper.DbInfoMapper;
import com.tony.easymvc.po.DbInfo;
import com.tony.easymvc.po.DbInfoExample;

@Controller @RequestMapping("db") public class DbInfoController {

    @Resource DbInfoMapper dbInfoMapper;

    
    
    @RequestMapping("add")
    @ResponseBody
    public String addDbInfo(DbInfo dbinfo) {
        dbInfoMapper.insert(dbinfo);
        return "dbinfo";
    }

    @RequestMapping("select")
    @ResponseBody
    public List<DbInfo> selectDbinfo() {
        return dbInfoMapper.selectByExample(new DbInfoExample());
    }

}
